<?php

if(!$this->getParentBlock()->getOrder() || !$this->getParentBlock()->getSlip())
{
	return;
}

$dadosboleto 			= $this->getSlipData();
$codigobanco 			= "341";
$codigo_banco_com_dv 	= $this->_generateBankNumber($codigobanco);
$nummoeda 				= "9";
$fator_vencimento 		= $this->_maturityFactor($dadosboleto["data_vencimento"]);


// =====================
// Configuracoes padroes
// =====================
// valor possui 10 digitos, sem virgula
// agencia possui 4 digitos
// conta possui 5 digitos + dv
// carteira 175
// nosso_numero no maximo 8 digitos
// 43 digitos para o calculo do digito verificador
// 44 digitos para o numero do codigo de barras
$valor 				= $this->_formatNumber($dadosboleto["valor_boleto"], 10, 0, "value");
$agencia 			= $this->_formatNumber($dadosboleto["agencia"], 4, 0);
$conta 				= $this->_formatNumber($dadosboleto["conta"], 5, 0);
$conta_dv 			= $this->_formatNumber($dadosboleto["conta_dv"], 1, 0);
$carteira 			= $dadosboleto["carteira"];
$nnum 				= $this->_formatNumber($dadosboleto["nosso_numero"], 8, 0);
$codigo_barras 		= $codigobanco . $nummoeda . $fator_vencimento . $valor . 
					  $carteira . $nnum . $this->_module_10($agencia . $conta . $carteira . $nnum) . 
					  $agencia . $conta.$this->_module_10($agencia . $conta) . '000';

$dv 				= $this->_generateBarCodeVerificationDigit($codigo_barras);
$linha 				= substr($codigo_barras, 0, 4).$dv.substr($codigo_barras, 4, 43);
$nossonumero 		= $carteira . '/' . $nnum . '-' . $this->_module_10($agencia . $conta . $carteira . $nnum);
$agencia_codigo 	= $agencia . " / " . $conta . "-" . $this->_module_10($agencia . $conta);


$dadosboleto["codigo_barras"] 			= $linha;
$dadosboleto["linha_digitavel"] 		= $this->_generateBarCodeNumber($linha); // verificar
$dadosboleto["agencia_codigo"] 			= $agencia_codigo ;
$dadosboleto["nosso_numero"] 			= $nossonumero;
$dadosboleto["codigo_banco_com_dv"] 	= $codigo_banco_com_dv;

?>

<style type="text/css">
	
	/* textos e imagens */
	.instructions
	{
		font: bold 10px Arial;
		color: #000000;
	}
	
	.header-bar-code-number
	{
		font: bold 12px Arial;
		color: #000000;
	}
	
	.company-logo
	{
		height: 45px;
	}
	
	.bank-logo
	{
		width: 150px;
		height: 37px;
		display: block;
	}
	
	.company-info
	{
		font-size: 9px;
		font-family: Arial, Helvetica, 'sans-serif';
	}
	
	.large-font
	{
		font: bold 20px Arial;
		color: #000000;
	}
	
	.medium-font
	{
		font: bold 15px Arial;
		color: #000000;
	}
	
	.small-font
	{
		font: bold 10px Arial;
		color: #000000;
	}
	
	.tiny-font
	{
		font: 9px "Arial Narrow";
		color: #000033;
	}
	
	/* estrutura */
	.container-row
	{
		width: 666px;
	}
	
	.cutting-line
	{
		width: 665px;
		height: 1px;
		display: block;
	}
	
	.solid-line
	{
		width: 666px;
		height: 2px;
		display: block;
	}
	
	.thin-solid-line
	{
		width: 666px;
		height: 1px;
		display: block;
	}
	
	.container-company-logo
	{
		float: left;
		margin-left: 20px;
		margin-right: 20px;
	}
	
	.large-vertical-separator
	{
		width: 2px;
		height: 22px;
		background-image: url('<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/3.png');
	}
	
	.small-vertical-separator
	{
		width: 1px;
		height: 13px;
		margin-right: 7px;
		display: block;
	}
	
</style>

<!-- cabecalho com instrucoes de impressao do documento -->
<div class="container-row instructions" style="text-align: center;">
	<span>Instruções de Impressão</span>
</div>

<div class="container-row instructions">
	<ul style="margin: 0;">
		<li>Imprima em impressora jato de tinta (ink jet) ou laser em qualidade normal ou alta (Não use modo econômico).</li>
		<li>Utilize folha A4 (210 x 297 mm) ou Carta (216 x 279 mm) e margens mínimas à esquerda e à direita do formulário.</li>
		<li>Corte na linha indicada. Não rasure, risque, fure ou dobre a região onde se encontra o código de barras.</li>
		<li>Caso não apareça o código de barras no final, clique em F5 para atualizar esta tela.</li>
		<li>Caso tenha problemas ao imprimir, copie a seqüencia numérica abaixo e pague no caixa eletrônico ou no internet banking:</li>
	</ul>
	<br />
	<div class="header-bar-code-number" style="margin-left: 28px;">
		Linha Digitável: &nbsp;<?php echo $dadosboleto["linha_digitavel"]; ?>
	</div>
	<div class="header-bar-code-number" style="margin-left: 28px;">
		Valor: &nbsp;&nbsp;R$ <?php echo $dadosboleto["valor_boleto"]; ?>
	</div>
</div>

<!-- separacao com marcacao para recorte -->
<div class="container-row" style="margin: 15px 0 15px 0;">
	<img alt="" class="cutting-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/6.png" />
	<div class="instructions" style="width: 665px; text-align: right;"> Recido do Sacado</div>
</div>

<!-- logomarca e informacoes da empresa -->
<div class="container-row">
	<div class="container-company-logo">
		<img class="company-logo" src="<?php echo $this->getSkinUrl('images/logo.png'); ?>" />
	</div>
	<div class="company-info">
		<?php echo $dadosboleto["identificacao"];  ?><br />
		<?php echo isset($dadosboleto["cpf_cnpj"]) ? $dadosboleto["cpf_cnpj"] . "<br />" : ''; ?>
		<?php echo $dadosboleto["endereco"]; ?><br />
		<?php echo $dadosboleto["cidade_uf"]; ?><br />
	</div>
</div>

<br />

<!-- primeiro quadro -->
<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr>
			<td valign="bottom">
				<img class="bank-logo" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/itau.png" />
			</td>
			<td valign="bottom" align="left">
				<div class="large-vertical-separator"></div>
			</td>
			<td valign="bottom" align="center">
				<div class="large-font" style="">
					<?php echo $dadosboleto["codigo_banco_com_dv"]; ?>
				</div>
			</td>
			<td valign="bottom" align="left">
				<div class="large-vertical-separator"></div>
			</td>
			<td valign="bottom" align="right">
				<div class="medium-font" style="margin-bottom: 4px;">
					<?php echo $dadosboleto["linha_digitavel"]; ?>
				</div>
			</td>
		</tr>
	</tbody>
</table>

<div class="container-row" style="margin-top: 3px;">
	<img alt="" class="solid-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
</div>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Cedente
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Agência / Código do Cedente
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Espécie
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" style="width: 53px;">
				Quantidade
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" style="width: 120px;">
				Nosso Número
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["cedente"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["agencia_codigo"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["especie"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["quantidade"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="right">
				<?php echo $dadosboleto["nosso_numero"]; ?>
			</td>
		</tr>
	</tbody>
</table>

<div class="container-row">
	<img alt="" class="thin-solid-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
</div>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Número do Documento
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				CPF/CNPJ
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Vencimento
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" style="width: 181px;">
				Valor Documento
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["numero_documento"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["cpf_cnpj"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["data_vencimento"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="right">
				<?php echo $dadosboleto["valor_boleto"]; ?>
			</td>
		</tr>
	</tbody>
</table>

<div class="container-row">
	<img alt="" class="thin-solid-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
</div>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				(-) Desconto / Abatimentos
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				(-) Outras deduções
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				(+) Mora / Multa
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				(+) Outros acréscimos
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" style="width: 181px;">
				(=) Valor cobrado
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				
			</td>
		</tr>
	</tbody>
</table>

<div class="container-row">
	<img alt="" class="thin-solid-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
</div>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Sacado
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["sacado"]; ?>
			</td>
		</tr>
	</tbody>
</table>

<div class="container-row">
	<img alt="" class="thin-solid-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
</div>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left" style="width: 8px;">
				
			</td>
			<td valign="top" align="left">
				Demonstrativo
			</td>
			<td valign="top" align="right">
				Autenticação Mecânica
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				
			</td>
			<td valign="top" align="left">
				<br />
				<?php echo $dadosboleto["demonstrativo1"]; ?><br />
				<?php echo $dadosboleto["demonstrativo2"]; ?><br />
			</td>
		</tr>
	</tbody>
</table>
<br />
<div class="container-row tiny-font" style="text-align: right;">
	Corte na linha pontilhada
</div>
<div class="container-row">
	<img alt="" class="cutting-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/6.png" />
</div>
<br />

<!-- segundo quadro -->
<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr>
			<td valign="bottom">
				<img class="bank-logo" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/itau.png" />
			</td>
			<td valign="bottom" align="left">
				<div class="large-vertical-separator"></div>
			</td>
			<td valign="bottom" align="center">
				<div class="large-font" style="">
					<?php echo $dadosboleto["codigo_banco_com_dv"]; ?>
				</div>
			</td>
			<td valign="bottom" align="left">
				<div class="large-vertical-separator"></div>
			</td>
			<td valign="bottom" align="right">
				<div class="medium-font" style="margin-bottom: 4px;">
					<?php echo $dadosboleto["linha_digitavel"]; ?>
				</div>
			</td>
		</tr>
	</tbody>
</table>

<div class="container-row" style="margin-top: 3px;">
	<img alt="" class="solid-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
</div>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Local de Pagamento
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" style="width: 181px;">
				Vencimento
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Pagável em qualquer Banco até o vencimento
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="right">
				<?php echo $dadosboleto["data_vencimento"]; ?>
			</td>
		</tr>
	</tbody>
</table>

<div class="container-row">
	<img alt="" class="thin-solid-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
</div>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Cedente
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" style="width: 181px;">
				Agência / Código cedente
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["cedente"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="right">
				<?php echo $dadosboleto["agencia_codigo"]; ?>
			</td>
		</tr>
	</tbody>
</table>

<div class="container-row">
	<img alt="" class="thin-solid-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
</div>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Data do documento
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				N<u>o</u> documento
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Espécie doc.
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Aceite
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Data processamento
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" style="width: 181px;">
				Nosso número
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["data_documento"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["numero_documento"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["especie_doc"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["aceite"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["data_processamento"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="right">
				<?php echo $dadosboleto["nosso_numero"]; ?>
			</td>
		</tr>
	</tbody>
</table>

<div class="container-row">
	<img alt="" class="thin-solid-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
</div>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Uso do banco
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Carteira
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Espécie
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Quantidade
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Valor documento
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" style="width: 181px;">
				(=) Valor documento
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["carteira"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["especie"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["quantidade"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				<?php echo $dadosboleto["valor_unitario"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="right">
				<?php echo $dadosboleto["valor_boleto"]; ?>
			</td>
		</tr>
	</tbody>
</table>

<div class="container-row">
	<img alt="" class="thin-solid-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
</div>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				Instruções (Texto de responsabilidade do cedente)
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" style="width: 181px;">
				(-) Desconto / Abatimentos
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left">
				
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="right">
				
			</td>
		</tr>
	</tbody>
</table>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left" style="width: 478px;">
				<table cellpadding="0" cellspacing="0" border="0">
					<tbody>
						<tr class="tiny-font">
							<td valign="top" align="left" style="width: 8px;">
								<img alt="" class="small-vertical-separator" style="height: 108px;" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
							</td>
							<td valign="top" align="left" class="instructions" style="width: 475px;">
								<?php echo $dadosboleto["instrucoes1"]; ?><br />
								<?php echo $dadosboleto["instrucoes2"]; ?><br />
								<?php echo $dadosboleto["instrucoes3"]; ?><br />
								<?php echo $dadosboleto["instrucoes4"]; ?>					
							</td>
							<td valign="top" align="left" style="width: 1px;">
								<img alt="" class="small-vertical-separator" style="height: 108px; margin: 0;" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
							</td>
						</tr>
					</tbody>
				</table>
			</td>
			<td valign="top" align="left" style="width: 188px;">
				<table cellpadding="0" cellspacing="0" border="0" style="width: 100%;">
					<tbody>
						<tr>
							<td style="height: 1px;" colspan="2">
								<img alt="" class="thin-solid-line" style="width: 100%;" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
							</td>
						</tr>
						<tr>
							<td style="width: 7px; height: 26px;">
								
							</td>
							<td valign="top" align="left">
								(-) Outras deduções
							</td>
						</tr>
						<tr>
							<td style="height: 1px;" colspan="2">
								<img alt="" class="thin-solid-line" style="width: 100%;" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
							</td>
						</tr>
						<tr>
							<td style="width: 7px; height: 26px;">
								
							</td>
							<td valign="top" align="left">
								(+) Mora / Multa
							</td>
						</tr>
						<tr>
							<td style="height: 1px;" colspan="2">
								<img alt="" class="thin-solid-line" style="width: 100%;" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
							</td>
						</tr>
						<tr>
							<td style="width: 7px; height: 26px;">
								
							</td>
							<td valign="top" align="left">
								(+) Outros acréscimos
							</td>
						</tr>
						<tr>
							<td style="height: 1px;" colspan="2">
								<img alt="" class="thin-solid-line" style="width: 100%;" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
							</td>
						</tr>
						<tr>
							<td style="width: 7px; height: 26px;">
								
							</td>
							<td valign="top" align="left">
								(=) Valor cobrado
							</td>
						</tr>
					</tbody>
				</table>
			</td>
		</tr>
	</tbody>
</table>

<div class="container-row">
	<img alt="" class="thin-solid-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
</div>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" colspan="3">
				Sacado
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" colspan="3">
				<?php echo $dadosboleto["sacado"]; ?>
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" colspan="3">
				<?php echo $dadosboleto["endereco1"]; ?>
			</td>
		</tr>
		<tr class="small-font">
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td valign="top" align="left" style="width: 475px;">
				<?php echo $dadosboleto["endereco2"]; ?>
			</td>
			<td valign="top" align="left" style="width: 8px;">
				<img alt="" class="small-vertical-separator" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/1.png" />
			</td>
			<td class="tiny-font" valign="top" align="left" style="width: 181px;">
				Cód. baixa
			</td>
		</tr>
	</tbody>
</table>

<div class="container-row">
	<img alt="" class="thin-solid-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/2.png" />
</div>

<table class="container-row" cellpadding="0" cellspacing="0" border="0">
	<tbody>
		<tr class="tiny-font">
			<td valign="top" align="left">
				Sacador / Avalista
			</td>
			<td valign="top" align="right">
				<span>Autenticação Mecânica -</span><span class="small-font">Ficha de Compensação</span>
			</td>
		</tr>
		<tr>
			<td rowspan="2">
				<?php echo $this->_generateBarCode($dadosboleto["codigo_barras"]); ?>
			</td>
		</tr>
	</tbody>
</table>
<div class="container-row tiny-font" style="text-align: right;">
	Corte na linha pontilhada
</div>
<div class="container-row">
	<img alt="" class="cutting-line" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>skin/frontend/default/default/images/maxima/bankslip/6.png" />
</div>